package com.ruoyi.merchant.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 分类对象 categories
 */
@Data
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Category extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 分类ID */
    private Long categoryId;

    /** 商家ID */
    @Excel(name = "商家ID")
    private Long merchantId;

    /** 分类名称 */
    @Excel(name = "分类名称")
    private String name;

    /** 父分类ID */
    @Excel(name = "父分类ID")
    private Long parentId;

    /** 排序 */
    @Excel(name = "排序")
    private Integer sortOrder;

    /** 状态：0-禁用，1-启用 */
    @Excel(name = "状态", readConverterExp = "0=禁用,1=启用")
    private Integer status;

    /** 删除时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date deletedAt;

    /** 预留字段1 */
    private String externField1;

    /** 预留字段2 */
    private String externField2;

    /** 子分类 */
    private List<Category> children = new ArrayList<>();
}
